#pragma once

#include "InputProcessor.h"
#include "GameState.h"
#include <vector>


class AnimatedImage;
class IGameController;
class CInputController;
class IRenderingManager;
class IMeshStorage;

enum MENU_OPTIONS
{
   MO_EASY_TRACK,
   MO_DIFFICULT_TRACK,
   MO_EXIT
};

class MainMenu : public IGameState, public IInputProcessor
{
private:
   IGameController& m_gameController;
   CInputController& m_inputController;
   IRenderingManager& m_renderingManager;
   AnimatedImage& m_mainMenuImage;
   AnimatedImage& m_selectionHighlight;

   float m_menuX;
   std::vector<float> m_menuY;
   int m_activeOption;
   bool m_selectionChanged;
   float m_timeUntilNextOptionChange;

public:
   MainMenu(IGameController& gameController,
            CInputController& inputController,
            IRenderingManager& renderingManager,
            IMeshStorage& meshStorage);

   void update(float timeElapsed);

   void activate();

   void deactivate();

   void processInput(UCHAR* keyBuffer, float timeElapsed);

private:
   void processBrowsing(UCHAR* keyBuffer);
   void processSelection(UCHAR* keyBuffer);
};
